﻿using FluentNHibernate.Mapping;
using SportStore.Model;

namespace SportStore.Data.NHibernate.Mappings
{
    /// <summary>
    /// Product class mapping.
    /// </summary>
    public class ProductMap : ClassMap<Product>
    {
        public ProductMap()
        {
            this.Table("Product");
            this.Id(x => x.ProductId).GeneratedBy.Identity().Column("ProductId");

            this.Map(x => x.Name).Column("Name");
            this.Map(x => x.Description).Column("Description");
            this.Map(x => x.Price).Not.Nullable().Column("Price");
            this.Map(x => x.Category).Not.Nullable().Column("Category");
        }
    }
}
